<%@ Page Language="C#" MasterPageFile="~/Site.master" Title="Eureka" AutoEventWireup="true" CodeBehind="Administrador.aspx.cs" Inherits="Eureka._Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="conteudo" Runat="Server">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script language="javascript" type="text/javascript">
      
        function getID(id)
        {
            if (id != "&nbsp;")
                document.getElementById('<%=txID.ClientID%>').value = id;                    
            else
                document.getElementById('<%=txID.ClientID%>').value = "";         
        }
        
        var gridViewCtlId = '<%=gridAdmin.ClientID%>';
        var gridViewCtl = null;
        var curSelRow = null;
    function getGridViewControl()
    {
        if (null == gridViewCtl)
        {
            gridViewCtl = document.getElementById(gridViewCtlId);
        }
    }
    
    function onGridViewRowSelected(rowIdx)
    {
        var selRow = getSelectedRow(rowIdx);
        if (curSelRow != null)
        {
            curSelRow.style.backgroundColor = '#FF9933';
        }
        
        if (null != selRow)
        {
            curSelRow = selRow;
            curSelRow.style.backgroundColor = '#33FF33';
        }
    }
    
    function getSelectedRow(rowIdx)
    {
        getGridViewControl();
        if (null != gridViewCtl)
        {
            return gridViewCtl.rows[rowIdx];
        }
        return null;
    }
</script>	

</head>
<body>

    <form id="form1">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Gerenciar Administradores" Width="254px"></asp:Label><br />
        <asp:Label ID="Label4" runat="server" Text="Login"></asp:Label>
        <asp:TextBox ID="txLoginBuscaAdmin" runat="server"></asp:TextBox>
        <asp:CheckBox ID="chkTodosAdmin" runat="server" Text="Todos" />
        <br />
        <asp:Button ID="bntListar" runat="server" OnClick="bntListar_Click" Text="OK" CausesValidation="false" /><br />
        <br />
        Lista de Administradores:<br />
        <div style="width: 850px; height: 280px; overflow: auto">
        <asp:GridView ID="gridAdmin" runat="server" OnRowDataBound="gridAdmin_RowDataBound" pagesize="10" AllowPaging="true"  onpageindexchanging="gridAdmin_PageIndexChanging">
        </asp:GridView>
        </div>
        <asp:Button ID="bntNovo" runat="server" OnClick="bntNovo_Click" Text="Novo" CausesValidation="false" />&nbsp;<asp:Button
            ID="bntEditar" runat="server" Text="Editar" OnClick="bntEditar_Click" CausesValidation="true" />
        <asp:Button ID="bntApagar" runat="server" OnClick="bntApagar_Click" Text="Apagar" CausesValidation="true" /><br />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Selecione um Administrador" ControlToValidate="txID"></asp:RequiredFieldValidator><br />
        <asp:Button ID="bntVoltar" runat="server" OnClick="bntVoltar_Click" Text="Voltar" CausesValidation="false" /><br />
        <asp:TextBox ID="txID" runat="server" Style="display:none"></asp:TextBox>&nbsp;
        </div>
    </form>
</body>
</html>
</asp:Content>